﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:Custom="http://schemas.microsoft.com/surface/2008" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:UserControls="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls" xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic">


    <Style  TargetType="{x:Type UserControls:SurfaceDragDropListBox}">
        <Style.Resources>
            <LinearGradientBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" EndPoint="1,0.5" StartPoint="0,0.5">
                <GradientStop Color="#33000000" Offset="0"/>
                <GradientStop Color="#00000000" Offset="1"/>
            </LinearGradientBrush>
        </Style.Resources>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,0" StartPoint="0,1">
                    <GradientStop Color="#FFA4B4BD" Offset="0"/>
                    <GradientStop Color="#FFDFE9EE" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
<!--
        <Setter Property="BorderBrush" Value="#11000000"/>
        <Setter Property="BorderThickness" Value="1,0,0,0"/>
        -->

        <Setter Property="BorderThickness" Value="0"/>
        
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="MinWidth" Value="74"/>
        <Setter Property="MinHeight" Value="74"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
        <Setter Property="Custom:SurfaceScrollViewer.Elasticity" Value="0,0.4"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        
        <Setter Property="Panel.Background" Value="{StaticResource ListBoxBackground}"/>       

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Custom:SurfaceListBox}">
                    <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" ClipToBounds="False" CornerRadius="0" Margin="{TemplateBinding Padding}" MinWidth="40" MinHeight="40" OpacityMask="{x:Null}" Padding="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                        <Custom:SurfaceScrollViewer x:Name="scrollViewer" Background="{x:Null}" ClipToBounds="False" Elasticity="{TemplateBinding Custom:SurfaceScrollViewer.Elasticity}" Foreground="{TemplateBinding Foreground}" Focusable="False" Height="Auto" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Margin="0" MinWidth="36" MinHeight="36" OpacityMask="{x:Null}" SnapsToDevicePixels="True" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" Width="Auto">
                            <Custom:SurfaceScrollViewer.Style>
                                <Style TargetType="{x:Type Custom:SurfaceScrollViewer}">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Custom:SurfaceScrollViewer}">
                                                <Grid Background="{TemplateBinding Background}" HorizontalAlignment="Stretch" Margin="0" OpacityMask="{x:Null}" SnapsToDevicePixels="False" VerticalAlignment="Stretch">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="*"/>
                                                        <ColumnDefinition Width="Auto"/>
                                                    </Grid.ColumnDefinitions>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="*"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <Border x:Name="PART_ElasticBorder" Background="{TemplateBinding Background}">
                                                        <ScrollContentPresenter CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" Grid.ColumnSpan="1" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" OpacityMask="{x:Null}" Grid.Row="0" Grid.RowSpan="1" SnapsToDevicePixels="True"/>
                                                    </Border>
                                                    <Custom:SurfaceScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Grid.Column="0" Height="Auto" LargeChange="1" Maximum="{TemplateBinding ScrollableWidth}" MaxHeight="30" Margin="3,0,3,3" MinWidth="30" Minimum="0" MinHeight="30" Orientation="Horizontal" Grid.Row="1" SnapsToDevicePixels="True" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}">
                                                        <Custom:SurfaceScrollBar.Style>
                                                            <Style TargetType="{x:Type Custom:SurfaceScrollBar}">
                                                                <Style.Resources>
                                                                    <System:Double x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">52</System:Double>
                                                                    <System:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}">52</System:Double>
                                                                </Style.Resources>
                                                                <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
                                                                <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
                                                                <Setter Property="BorderBrush" Value="#33000000"/>
                                                                <Setter Property="Background">
                                                                    <Setter.Value>
                                                                        <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                                            <GradientStop Color="#33364E5C" Offset="0"/>
                                                                            <GradientStop Color="#0C364E5C" Offset="1"/>
                                                                        </LinearGradientBrush>
                                                                    </Setter.Value>
                                                                </Setter>
                                                                <Setter Property="Width" Value="30"/>
                                                                <Setter Property="MinWidth" Value="30"/>
                                                                <Setter Property="Height" Value="Auto"/>
                                                                <Setter Property="MinHeight" Value="30"/>
                                                                <Setter Property="VerticalAlignment" Value="Stretch"/>
                                                                <Setter Property="HorizontalAlignment" Value="Stretch"/>
                                                                <Setter Property="Template">
                                                                    <Setter.Value>
                                                                        <ControlTemplate TargetType="{x:Type Custom:SurfaceScrollBar}">
                                                                            <ControlTemplate.Resources>
                                                                                <Storyboard x:Key="Touch">
                                                                                    <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                                    <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                    <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                </Storyboard>
                                                                                <Storyboard x:Key="Release">
                                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                </Storyboard>
                                                                            </ControlTemplate.Resources>
                                                                            <Grid x:Name="GridRoot" Background="Transparent" HorizontalAlignment="Stretch" MinWidth="30" MinHeight="30" SnapsToDevicePixels="True" Width="Auto">
                                                                                <Rectangle x:Name="TrackBkgd" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="Auto" RadiusY="4" RadiusX="4" Stroke="{TemplateBinding BorderBrush}" VerticalAlignment="Stretch" Width="8"/>
                                                                                <Border x:Name="Track" Background="Transparent" HorizontalAlignment="Stretch" Opacity="1" SnapsToDevicePixels="True">
                                                                                    <Track x:Name="PART_Track" IsDirectionReversed="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                                                                        <Track.DecreaseRepeatButton>
                                                                                            <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageUpCommand" SnapsToDevicePixels="True">
                                                                                                <Custom:SurfaceRepeatButton.Style>
                                                                                                    <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                        <Setter Property="Background" Value="{x:Null}"/>
                                                                                                        <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                                        <Setter Property="IsTabStop" Value="False"/>
                                                                                                        <Setter Property="Focusable" Value="False"/>
                                                                                                        <Setter Property="Interval" Value="300"/>
                                                                                                        <Setter Property="Padding" Value="-5"/>
                                                                                                        <Setter Property="Template">
                                                                                                            <Setter.Value>
                                                                                                                <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                    <Grid>
                                                                                                                        <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                                    </Grid>
                                                                                                                </ControlTemplate>
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                    </Style>
                                                                                                </Custom:SurfaceRepeatButton.Style>
                                                                                            </Custom:SurfaceRepeatButton>
                                                                                        </Track.DecreaseRepeatButton>
                                                                                        <Track.IncreaseRepeatButton>
                                                                                            <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageDownCommand" SnapsToDevicePixels="True">
                                                                                                <Custom:SurfaceRepeatButton.Style>
                                                                                                    <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                        <Setter Property="Background" Value="{x:Null}"/>
                                                                                                        <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                                        <Setter Property="IsTabStop" Value="False"/>
                                                                                                        <Setter Property="Focusable" Value="False"/>
                                                                                                        <Setter Property="Interval" Value="300"/>
                                                                                                        <Setter Property="Padding" Value="-5"/>
                                                                                                        <Setter Property="Template">
                                                                                                            <Setter.Value>
                                                                                                                <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                    <Grid>
                                                                                                                        <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                                    </Grid>
                                                                                                                </ControlTemplate>
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                    </Style>
                                                                                                </Custom:SurfaceRepeatButton.Style>
                                                                                            </Custom:SurfaceRepeatButton>
                                                                                        </Track.IncreaseRepeatButton>
                                                                                        <Track.Thumb>
                                                                                            <Custom:SurfaceThumb x:Name="Thumb" Background="White" MinWidth="8" MinHeight="8" SnapsToDevicePixels="True">
                                                                                                <Custom:SurfaceThumb.BorderBrush>
                                                                                                    <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                                                        <GradientStop Color="#66000000" Offset="0"/>
                                                                                                        <GradientStop Color="#33000000" Offset="1"/>
                                                                                                    </LinearGradientBrush>
                                                                                                </Custom:SurfaceThumb.BorderBrush>
                                                                                                <Custom:SurfaceThumb.Style>
                                                                                                    <Style TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                                        <Setter Property="Background">
                                                                                                            <Setter.Value>
                                                                                                                <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                                                                    <GradientStop Color="#66000000" Offset="0"/>
                                                                                                                    <GradientStop Color="#33000000" Offset="1"/>
                                                                                                                </LinearGradientBrush>
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                        <Setter Property="BorderBrush">
                                                                                                            <Setter.Value>
                                                                                                                <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                                                    <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                                    <GradientStop Color="#19000000" Offset="1"/>
                                                                                                                </LinearGradientBrush>
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                        <Setter Property="Template">
                                                                                                            <Setter.Value>
                                                                                                                <ControlTemplate TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                                                    <ControlTemplate.Resources>
                                                                                                                        <Storyboard x:Key="Press">
                                                                                                                            <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                            <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                        </Storyboard>
                                                                                                                        <Storyboard x:Key="Release">
                                                                                                                            <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                            <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                        </Storyboard>
                                                                                                                    </ControlTemplate.Resources>
                                                                                                                    <Grid x:Name="Grid" Background="Transparent" Height="Auto" SnapsToDevicePixels="True" Width="{TemplateBinding MinWidth}">
                                                                                                                        <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="Auto" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" VerticalAlignment="Stretch"/>
                                                                                                                        <Rectangle x:Name="RenderOverlay" HorizontalAlignment="Stretch" Height="Auto" Margin="1" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" VerticalAlignment="Stretch">
                                                                                                                            <Rectangle.Fill>
                                                                                                                                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                                                                                                    <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                                                                                                    <GradientStop Color="#0C000000" Offset="1"/>
                                                                                                                                </LinearGradientBrush>
                                                                                                                            </Rectangle.Fill>
                                                                                                                            <Rectangle.Stroke>
                                                                                                                                <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                                                                    <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                                                    <GradientStop Color="#19000000" Offset="1"/>
                                                                                                                                </LinearGradientBrush>
                                                                                                                            </Rectangle.Stroke>
                                                                                                                        </Rectangle>
                                                                                                                        <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" Color="White" CornerRadius="3" IsHitTestVisible="True" Margin="-1" Opacity="0"/>
                                                                                                                    </Grid>
                                                                                                                    <ControlTemplate.Triggers>
                                                                                                                        <Trigger Property="IsFocused" Value="True"/>
                                                                                                                        <Trigger Property="IsDragging" Value="True">
                                                                                                                            <Trigger.EnterActions>
                                                                                                                                <BeginStoryboard>
                                                                                                                                    <Storyboard>
                                                                                                                                        <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                        <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                    </Storyboard>
                                                                                                                                </BeginStoryboard>
                                                                                                                            </Trigger.EnterActions>
                                                                                                                            <Trigger.ExitActions>
                                                                                                                                <BeginStoryboard>
                                                                                                                                    <Storyboard>
                                                                                                                                        <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                        <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                    </Storyboard>
                                                                                                                                </BeginStoryboard>
                                                                                                                            </Trigger.ExitActions>
                                                                                                                        </Trigger>
                                                                                                                        <Trigger Property="IsEnabled" Value="False">
                                                                                                                            <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                                                                                        </Trigger>
                                                                                                                    </ControlTemplate.Triggers>
                                                                                                                </ControlTemplate>
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                    </Style>
                                                                                                </Custom:SurfaceThumb.Style>
                                                                                            </Custom:SurfaceThumb>
                                                                                        </Track.Thumb>
                                                                                    </Track>
                                                                                </Border>
                                                                            </Grid>
                                                                            <ControlTemplate.Triggers>
                                                                                <Trigger Property="Custom:TouchExtensions.AreAnyInputDevicesCapturedWithin" Value="True">
                                                                                    <Trigger.EnterActions>
                                                                                        <BeginStoryboard>
                                                                                            <Storyboard>
                                                                                                <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                                                <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                                <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                            </Storyboard>
                                                                                        </BeginStoryboard>
                                                                                    </Trigger.EnterActions>
                                                                                    <Trigger.ExitActions>
                                                                                        <BeginStoryboard>
                                                                                            <Storyboard>
                                                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                            </Storyboard>
                                                                                        </BeginStoryboard>
                                                                                    </Trigger.ExitActions>
                                                                                </Trigger>
                                                                                <Trigger Property="IsEnabled" Value="False">
                                                                                    <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                                                                    <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                                                                    <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                                                                    <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                                                                </Trigger>
                                                                            </ControlTemplate.Triggers>
                                                                        </ControlTemplate>
                                                                    </Setter.Value>
                                                                </Setter>
                                                                <Style.Triggers>
                                                                    <Trigger Property="Orientation" Value="Horizontal">
                                                                        <Setter Property="Width" Value="Auto"/>
                                                                        <Setter Property="MinWidth" Value="30"/>
                                                                        <Setter Property="Height" Value="30"/>
                                                                        <Setter Property="MinHeight" Value="30"/>
                                                                        <Setter Property="Background">
                                                                            <Setter.Value>
                                                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                    <GradientStop Color="#33364E5C" Offset="0"/>
                                                                                    <GradientStop Color="#0C364E5C" Offset="1"/>
                                                                                </LinearGradientBrush>
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                        <Setter Property="VerticalAlignment" Value="Stretch"/>
                                                                        <Setter Property="HorizontalAlignment" Value="Stretch"/>
                                                                        <Setter Property="Template">
                                                                            <Setter.Value>
                                                                                <ControlTemplate TargetType="{x:Type Custom:SurfaceScrollBar}">
                                                                                    <ControlTemplate.Resources>
                                                                                        <Storyboard x:Key="Touch">
                                                                                            <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                                            <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                            <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                        </Storyboard>
                                                                                        <Storyboard x:Key="Release">
                                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                        </Storyboard>
                                                                                    </ControlTemplate.Resources>
                                                                                    <Grid x:Name="GridRoot" Background="Transparent" Height="Auto" MinWidth="30" MinHeight="30" SnapsToDevicePixels="True">
                                                                                        <Rectangle x:Name="TrackBkgd" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="8" RadiusY="4" RadiusX="4" Stroke="{TemplateBinding BorderBrush}" VerticalAlignment="Stretch" Width="Auto"/>
                                                                                        <Border x:Name="Track" Background="Transparent" HorizontalAlignment="Stretch" Opacity="1" SnapsToDevicePixels="True" VerticalAlignment="Stretch">
                                                                                            <Track x:Name="PART_Track" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                                                                                <Track.DecreaseRepeatButton>
                                                                                                    <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageLeftCommand" SnapsToDevicePixels="True">
                                                                                                        <Custom:SurfaceRepeatButton.Style>
                                                                                                            <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                <Setter Property="Background" Value="{x:Null}"/>
                                                                                                                <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                                                <Setter Property="IsTabStop" Value="False"/>
                                                                                                                <Setter Property="Focusable" Value="False"/>
                                                                                                                <Setter Property="Interval" Value="300"/>
                                                                                                                <Setter Property="Padding" Value="-5"/>
                                                                                                                <Setter Property="Template">
                                                                                                                    <Setter.Value>
                                                                                                                        <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                            <Grid>
                                                                                                                                <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                                            </Grid>
                                                                                                                        </ControlTemplate>
                                                                                                                    </Setter.Value>
                                                                                                                </Setter>
                                                                                                            </Style>
                                                                                                        </Custom:SurfaceRepeatButton.Style>
                                                                                                    </Custom:SurfaceRepeatButton>
                                                                                                </Track.DecreaseRepeatButton>
                                                                                                <Track.IncreaseRepeatButton>
                                                                                                    <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageRightCommand" SnapsToDevicePixels="True">
                                                                                                        <Custom:SurfaceRepeatButton.Style>
                                                                                                            <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                <Setter Property="Background" Value="{x:Null}"/>
                                                                                                                <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                                                <Setter Property="IsTabStop" Value="False"/>
                                                                                                                <Setter Property="Focusable" Value="False"/>
                                                                                                                <Setter Property="Interval" Value="300"/>
                                                                                                                <Setter Property="Padding" Value="-5"/>
                                                                                                                <Setter Property="Template">
                                                                                                                    <Setter.Value>
                                                                                                                        <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                            <Grid>
                                                                                                                                <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                                            </Grid>
                                                                                                                        </ControlTemplate>
                                                                                                                    </Setter.Value>
                                                                                                                </Setter>
                                                                                                            </Style>
                                                                                                        </Custom:SurfaceRepeatButton.Style>
                                                                                                    </Custom:SurfaceRepeatButton>
                                                                                                </Track.IncreaseRepeatButton>
                                                                                                <Track.Thumb>
                                                                                                    <Custom:SurfaceThumb x:Name="Thumb" Background="White" MinWidth="8" MinHeight="8" SnapsToDevicePixels="True">
                                                                                                        <Custom:SurfaceThumb.BorderBrush>
                                                                                                            <LinearGradientBrush EndPoint="1.007,0.495" StartPoint="-0.007,0.495">
                                                                                                                <GradientStop Color="#66000000" Offset="0"/>
                                                                                                                <GradientStop Color="#33000000" Offset="1"/>
                                                                                                            </LinearGradientBrush>
                                                                                                        </Custom:SurfaceThumb.BorderBrush>
                                                                                                        <Custom:SurfaceThumb.Style>
                                                                                                            <Style TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                                                <Setter Property="Background">
                                                                                                                    <Setter.Value>
                                                                                                                        <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                                                                            <GradientStop Color="#66000000" Offset="0"/>
                                                                                                                            <GradientStop Color="#33000000" Offset="1"/>
                                                                                                                        </LinearGradientBrush>
                                                                                                                    </Setter.Value>
                                                                                                                </Setter>
                                                                                                                <Setter Property="BorderBrush">
                                                                                                                    <Setter.Value>
                                                                                                                        <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                                                            <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                                            <GradientStop Color="#19000000" Offset="1"/>
                                                                                                                        </LinearGradientBrush>
                                                                                                                    </Setter.Value>
                                                                                                                </Setter>
                                                                                                                <Setter Property="Template">
                                                                                                                    <Setter.Value>
                                                                                                                        <ControlTemplate TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                                                            <ControlTemplate.Resources>
                                                                                                                                <Storyboard x:Key="Press">
                                                                                                                                    <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                    <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                </Storyboard>
                                                                                                                                <Storyboard x:Key="Release">
                                                                                                                                    <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                    <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                </Storyboard>
                                                                                                                            </ControlTemplate.Resources>
                                                                                                                            <Grid x:Name="Grid" Background="Transparent" Height="{TemplateBinding MinHeight}" SnapsToDevicePixels="True" Width="Auto">
                                                                                                                                <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" VerticalAlignment="Stretch" Width="Auto"/>
                                                                                                                                <Rectangle x:Name="RenderOverlay" HorizontalAlignment="Stretch" Margin="1" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" VerticalAlignment="Stretch" Width="Auto">
                                                                                                                                    <Rectangle.Fill>
                                                                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                                                                            <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                                                                                                            <GradientStop Color="#0C000000" Offset="1"/>
                                                                                                                                        </LinearGradientBrush>
                                                                                                                                    </Rectangle.Fill>
                                                                                                                                    <Rectangle.Stroke>
                                                                                                                                        <LinearGradientBrush EndPoint="0.563,1.015" StartPoint="0.563,-0.026">
                                                                                                                                            <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                                                            <GradientStop Color="#19000000" Offset="1"/>
                                                                                                                                        </LinearGradientBrush>
                                                                                                                                    </Rectangle.Stroke>
                                                                                                                                </Rectangle>
                                                                                                                                <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" Color="White" CornerRadius="3" IsHitTestVisible="True" Margin="-1" Opacity="0"/>
                                                                                                                            </Grid>
                                                                                                                            <ControlTemplate.Triggers>
                                                                                                                                <Trigger Property="IsFocused" Value="True"/>
                                                                                                                                <Trigger Property="IsDragging" Value="True">
                                                                                                                                    <Trigger.EnterActions>
                                                                                                                                        <BeginStoryboard>
                                                                                                                                            <Storyboard>
                                                                                                                                                <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                                <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                            </Storyboard>
                                                                                                                                        </BeginStoryboard>
                                                                                                                                    </Trigger.EnterActions>
                                                                                                                                    <Trigger.ExitActions>
                                                                                                                                        <BeginStoryboard>
                                                                                                                                            <Storyboard>
                                                                                                                                                <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                                <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                            </Storyboard>
                                                                                                                                        </BeginStoryboard>
                                                                                                                                    </Trigger.ExitActions>
                                                                                                                                </Trigger>
                                                                                                                                <Trigger Property="IsEnabled" Value="False">
                                                                                                                                    <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                                                                                                </Trigger>
                                                                                                                            </ControlTemplate.Triggers>
                                                                                                                        </ControlTemplate>
                                                                                                                    </Setter.Value>
                                                                                                                </Setter>
                                                                                                            </Style>
                                                                                                        </Custom:SurfaceThumb.Style>
                                                                                                    </Custom:SurfaceThumb>
                                                                                                </Track.Thumb>
                                                                                            </Track>
                                                                                        </Border>
                                                                                    </Grid>
                                                                                    <ControlTemplate.Triggers>
                                                                                        <Trigger Property="Custom:TouchExtensions.AreAnyInputDevicesCapturedWithin" Value="True">
                                                                                            <Trigger.EnterActions>
                                                                                                <BeginStoryboard>
                                                                                                    <Storyboard>
                                                                                                        <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                                                        <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                                        <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                                    </Storyboard>
                                                                                                </BeginStoryboard>
                                                                                            </Trigger.EnterActions>
                                                                                            <Trigger.ExitActions>
                                                                                                <BeginStoryboard>
                                                                                                    <Storyboard>
                                                                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                                    </Storyboard>
                                                                                                </BeginStoryboard>
                                                                                            </Trigger.ExitActions>
                                                                                        </Trigger>
                                                                                        <Trigger Property="IsEnabled" Value="False">
                                                                                            <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                                                                            <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                                                                            <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                                                                            <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                                                                        </Trigger>
                                                                                    </ControlTemplate.Triggers>
                                                                                </ControlTemplate>
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                    </Trigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Custom:SurfaceScrollBar.Style>
                                                    </Custom:SurfaceScrollBar>
                                                    <Custom:SurfaceScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Grid.Column="1" LargeChange="1" Maximum="{TemplateBinding ScrollableHeight}" MaxWidth="30" Margin="0,3,3,3" MinWidth="30" Minimum="0" MinHeight="30" Orientation="Vertical" Grid.Row="0" SnapsToDevicePixels="True" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Width="Auto">
                                                        <Custom:SurfaceScrollBar.Style>
                                                            <Style TargetType="{x:Type Custom:SurfaceScrollBar}">
                                                                <Style.Resources>
                                                                    <System:Double x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">52</System:Double>
                                                                    <System:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}">52</System:Double>
                                                                </Style.Resources>
                                                                <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
                                                                <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
                                                                <Setter Property="BorderBrush" Value="#33000000"/>
                                                                <Setter Property="Background">
                                                                    <Setter.Value>
                                                                        <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                                            <GradientStop Color="#33364E5C" Offset="0"/>
                                                                            <GradientStop Color="#0C364E5C" Offset="1"/>
                                                                        </LinearGradientBrush>
                                                                    </Setter.Value>
                                                                </Setter>
                                                                <Setter Property="Width" Value="30"/>
                                                                <Setter Property="MinWidth" Value="30"/>
                                                                <Setter Property="Height" Value="Auto"/>
                                                                <Setter Property="MinHeight" Value="30"/>
                                                                <Setter Property="VerticalAlignment" Value="Stretch"/>
                                                                <Setter Property="HorizontalAlignment" Value="Stretch"/>
                                                                <Setter Property="Template">
                                                                    <Setter.Value>
                                                                        <ControlTemplate TargetType="{x:Type Custom:SurfaceScrollBar}">
                                                                            <ControlTemplate.Resources>
                                                                                <Storyboard x:Key="Touch">
                                                                                    <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                                    <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                    <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                </Storyboard>
                                                                                <Storyboard x:Key="Release">
                                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                </Storyboard>
                                                                            </ControlTemplate.Resources>
                                                                            <Grid x:Name="GridRoot" Background="Transparent" HorizontalAlignment="Stretch" MinWidth="30" MinHeight="30" SnapsToDevicePixels="True" Width="Auto">
                                                                                <Rectangle x:Name="TrackBkgd" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="Auto" RadiusY="4" RadiusX="4" Stroke="{TemplateBinding BorderBrush}" VerticalAlignment="Stretch" Width="8"/>
                                                                                <Border x:Name="Track" Background="Transparent" HorizontalAlignment="Stretch" Opacity="1" SnapsToDevicePixels="True">
                                                                                    <Track x:Name="PART_Track" IsDirectionReversed="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                                                                        <Track.DecreaseRepeatButton>
                                                                                            <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageUpCommand" SnapsToDevicePixels="True">
                                                                                                <Custom:SurfaceRepeatButton.Style>
                                                                                                    <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                        <Setter Property="Background" Value="{x:Null}"/>
                                                                                                        <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                                        <Setter Property="IsTabStop" Value="False"/>
                                                                                                        <Setter Property="Focusable" Value="False"/>
                                                                                                        <Setter Property="Interval" Value="300"/>
                                                                                                        <Setter Property="Padding" Value="-5"/>
                                                                                                        <Setter Property="Template">
                                                                                                            <Setter.Value>
                                                                                                                <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                    <Grid>
                                                                                                                        <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                                    </Grid>
                                                                                                                </ControlTemplate>
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                    </Style>
                                                                                                </Custom:SurfaceRepeatButton.Style>
                                                                                            </Custom:SurfaceRepeatButton>
                                                                                        </Track.DecreaseRepeatButton>
                                                                                        <Track.IncreaseRepeatButton>
                                                                                            <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageDownCommand" SnapsToDevicePixels="True">
                                                                                                <Custom:SurfaceRepeatButton.Style>
                                                                                                    <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                        <Setter Property="Background" Value="{x:Null}"/>
                                                                                                        <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                                        <Setter Property="IsTabStop" Value="False"/>
                                                                                                        <Setter Property="Focusable" Value="False"/>
                                                                                                        <Setter Property="Interval" Value="300"/>
                                                                                                        <Setter Property="Padding" Value="-5"/>
                                                                                                        <Setter Property="Template">
                                                                                                            <Setter.Value>
                                                                                                                <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                    <Grid>
                                                                                                                        <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                                    </Grid>
                                                                                                                </ControlTemplate>
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                    </Style>
                                                                                                </Custom:SurfaceRepeatButton.Style>
                                                                                            </Custom:SurfaceRepeatButton>
                                                                                        </Track.IncreaseRepeatButton>
                                                                                        <Track.Thumb>
                                                                                            <Custom:SurfaceThumb x:Name="Thumb" Background="White" MinWidth="8" MinHeight="8" SnapsToDevicePixels="True">
                                                                                                <Custom:SurfaceThumb.BorderBrush>
                                                                                                    <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                                                        <GradientStop Color="#66000000" Offset="0"/>
                                                                                                        <GradientStop Color="#33000000" Offset="1"/>
                                                                                                    </LinearGradientBrush>
                                                                                                </Custom:SurfaceThumb.BorderBrush>
                                                                                                <Custom:SurfaceThumb.Style>
                                                                                                    <Style TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                                        <Setter Property="Background">
                                                                                                            <Setter.Value>
                                                                                                                <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                                                                    <GradientStop Color="#66000000" Offset="0"/>
                                                                                                                    <GradientStop Color="#33000000" Offset="1"/>
                                                                                                                </LinearGradientBrush>
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                        <Setter Property="BorderBrush">
                                                                                                            <Setter.Value>
                                                                                                                <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                                                    <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                                    <GradientStop Color="#19000000" Offset="1"/>
                                                                                                                </LinearGradientBrush>
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                        <Setter Property="Template">
                                                                                                            <Setter.Value>
                                                                                                                <ControlTemplate TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                                                    <ControlTemplate.Resources>
                                                                                                                        <Storyboard x:Key="Press">
                                                                                                                            <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                            <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                        </Storyboard>
                                                                                                                        <Storyboard x:Key="Release">
                                                                                                                            <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                            <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                        </Storyboard>
                                                                                                                    </ControlTemplate.Resources>
                                                                                                                    <Grid x:Name="Grid" Background="Transparent" Height="Auto" SnapsToDevicePixels="True" Width="{TemplateBinding MinWidth}">
                                                                                                                        <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="Auto" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" VerticalAlignment="Stretch"/>
                                                                                                                        <Rectangle x:Name="RenderOverlay" HorizontalAlignment="Stretch" Height="Auto" Margin="1" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" VerticalAlignment="Stretch">
                                                                                                                            <Rectangle.Fill>
                                                                                                                                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                                                                                                    <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                                                                                                    <GradientStop Color="#0C000000" Offset="1"/>
                                                                                                                                </LinearGradientBrush>
                                                                                                                            </Rectangle.Fill>
                                                                                                                            <Rectangle.Stroke>
                                                                                                                                <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                                                                    <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                                                    <GradientStop Color="#19000000" Offset="1"/>
                                                                                                                                </LinearGradientBrush>
                                                                                                                            </Rectangle.Stroke>
                                                                                                                        </Rectangle>
                                                                                                                        <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" Color="White" CornerRadius="3" IsHitTestVisible="True" Margin="-1" Opacity="0"/>
                                                                                                                    </Grid>
                                                                                                                    <ControlTemplate.Triggers>
                                                                                                                        <Trigger Property="IsFocused" Value="True"/>
                                                                                                                        <Trigger Property="IsDragging" Value="True">
                                                                                                                            <Trigger.EnterActions>
                                                                                                                                <BeginStoryboard>
                                                                                                                                    <Storyboard>
                                                                                                                                        <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                        <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                    </Storyboard>
                                                                                                                                </BeginStoryboard>
                                                                                                                            </Trigger.EnterActions>
                                                                                                                            <Trigger.ExitActions>
                                                                                                                                <BeginStoryboard>
                                                                                                                                    <Storyboard>
                                                                                                                                        <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                        <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                    </Storyboard>
                                                                                                                                </BeginStoryboard>
                                                                                                                            </Trigger.ExitActions>
                                                                                                                        </Trigger>
                                                                                                                        <Trigger Property="IsEnabled" Value="False">
                                                                                                                            <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                                                                                        </Trigger>
                                                                                                                    </ControlTemplate.Triggers>
                                                                                                                </ControlTemplate>
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                    </Style>
                                                                                                </Custom:SurfaceThumb.Style>
                                                                                            </Custom:SurfaceThumb>
                                                                                        </Track.Thumb>
                                                                                    </Track>
                                                                                </Border>
                                                                            </Grid>
                                                                            <ControlTemplate.Triggers>
                                                                                <Trigger Property="Custom:TouchExtensions.AreAnyInputDevicesCapturedWithin" Value="True">
                                                                                    <Trigger.EnterActions>
                                                                                        <BeginStoryboard>
                                                                                            <Storyboard>
                                                                                                <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                                                <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                                <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                            </Storyboard>
                                                                                        </BeginStoryboard>
                                                                                    </Trigger.EnterActions>
                                                                                    <Trigger.ExitActions>
                                                                                        <BeginStoryboard>
                                                                                            <Storyboard>
                                                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                            </Storyboard>
                                                                                        </BeginStoryboard>
                                                                                    </Trigger.ExitActions>
                                                                                </Trigger>
                                                                                <Trigger Property="IsEnabled" Value="False">
                                                                                    <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                                                                    <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                                                                    <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                                                                    <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                                                                </Trigger>
                                                                            </ControlTemplate.Triggers>
                                                                        </ControlTemplate>
                                                                    </Setter.Value>
                                                                </Setter>
                                                                <Style.Triggers>
                                                                    <Trigger Property="Orientation" Value="Horizontal">
                                                                        <Setter Property="Width" Value="Auto"/>
                                                                        <Setter Property="MinWidth" Value="30"/>
                                                                        <Setter Property="Height" Value="30"/>
                                                                        <Setter Property="MinHeight" Value="30"/>
                                                                        <Setter Property="Background">
                                                                            <Setter.Value>
                                                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                    <GradientStop Color="#33364E5C" Offset="0"/>
                                                                                    <GradientStop Color="#0C364E5C" Offset="1"/>
                                                                                </LinearGradientBrush>
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                        <Setter Property="VerticalAlignment" Value="Stretch"/>
                                                                        <Setter Property="HorizontalAlignment" Value="Stretch"/>
                                                                        <Setter Property="Template">
                                                                            <Setter.Value>
                                                                                <ControlTemplate TargetType="{x:Type Custom:SurfaceScrollBar}">
                                                                                    <ControlTemplate.Resources>
                                                                                        <Storyboard x:Key="Touch">
                                                                                            <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                                            <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                            <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                        </Storyboard>
                                                                                        <Storyboard x:Key="Release">
                                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                        </Storyboard>
                                                                                    </ControlTemplate.Resources>
                                                                                    <Grid x:Name="GridRoot" Background="Transparent" Height="Auto" MinWidth="30" MinHeight="30" SnapsToDevicePixels="True">
                                                                                        <Rectangle x:Name="TrackBkgd" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="8" RadiusY="4" RadiusX="4" Stroke="{TemplateBinding BorderBrush}" VerticalAlignment="Stretch" Width="Auto"/>
                                                                                        <Border x:Name="Track" Background="Transparent" HorizontalAlignment="Stretch" Opacity="1" SnapsToDevicePixels="True" VerticalAlignment="Stretch">
                                                                                            <Track x:Name="PART_Track" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                                                                                <Track.DecreaseRepeatButton>
                                                                                                    <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageLeftCommand" SnapsToDevicePixels="True">
                                                                                                        <Custom:SurfaceRepeatButton.Style>
                                                                                                            <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                <Setter Property="Background" Value="{x:Null}"/>
                                                                                                                <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                                                <Setter Property="IsTabStop" Value="False"/>
                                                                                                                <Setter Property="Focusable" Value="False"/>
                                                                                                                <Setter Property="Interval" Value="300"/>
                                                                                                                <Setter Property="Padding" Value="-5"/>
                                                                                                                <Setter Property="Template">
                                                                                                                    <Setter.Value>
                                                                                                                        <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                            <Grid>
                                                                                                                                <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                                            </Grid>
                                                                                                                        </ControlTemplate>
                                                                                                                    </Setter.Value>
                                                                                                                </Setter>
                                                                                                            </Style>
                                                                                                        </Custom:SurfaceRepeatButton.Style>
                                                                                                    </Custom:SurfaceRepeatButton>
                                                                                                </Track.DecreaseRepeatButton>
                                                                                                <Track.IncreaseRepeatButton>
                                                                                                    <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageRightCommand" SnapsToDevicePixels="True">
                                                                                                        <Custom:SurfaceRepeatButton.Style>
                                                                                                            <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                <Setter Property="Background" Value="{x:Null}"/>
                                                                                                                <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                                                <Setter Property="IsTabStop" Value="False"/>
                                                                                                                <Setter Property="Focusable" Value="False"/>
                                                                                                                <Setter Property="Interval" Value="300"/>
                                                                                                                <Setter Property="Padding" Value="-5"/>
                                                                                                                <Setter Property="Template">
                                                                                                                    <Setter.Value>
                                                                                                                        <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                                            <Grid>
                                                                                                                                <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                                            </Grid>
                                                                                                                        </ControlTemplate>
                                                                                                                    </Setter.Value>
                                                                                                                </Setter>
                                                                                                            </Style>
                                                                                                        </Custom:SurfaceRepeatButton.Style>
                                                                                                    </Custom:SurfaceRepeatButton>
                                                                                                </Track.IncreaseRepeatButton>
                                                                                                <Track.Thumb>
                                                                                                    <Custom:SurfaceThumb x:Name="Thumb" Background="White" MinWidth="8" MinHeight="8" SnapsToDevicePixels="True">
                                                                                                        <Custom:SurfaceThumb.BorderBrush>
                                                                                                            <LinearGradientBrush EndPoint="1.007,0.495" StartPoint="-0.007,0.495">
                                                                                                                <GradientStop Color="#66000000" Offset="0"/>
                                                                                                                <GradientStop Color="#33000000" Offset="1"/>
                                                                                                            </LinearGradientBrush>
                                                                                                        </Custom:SurfaceThumb.BorderBrush>
                                                                                                        <Custom:SurfaceThumb.Style>
                                                                                                            <Style TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                                                <Setter Property="Background">
                                                                                                                    <Setter.Value>
                                                                                                                        <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                                                                            <GradientStop Color="#66000000" Offset="0"/>
                                                                                                                            <GradientStop Color="#33000000" Offset="1"/>
                                                                                                                        </LinearGradientBrush>
                                                                                                                    </Setter.Value>
                                                                                                                </Setter>
                                                                                                                <Setter Property="BorderBrush">
                                                                                                                    <Setter.Value>
                                                                                                                        <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                                                            <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                                            <GradientStop Color="#19000000" Offset="1"/>
                                                                                                                        </LinearGradientBrush>
                                                                                                                    </Setter.Value>
                                                                                                                </Setter>
                                                                                                                <Setter Property="Template">
                                                                                                                    <Setter.Value>
                                                                                                                        <ControlTemplate TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                                                            <ControlTemplate.Resources>
                                                                                                                                <Storyboard x:Key="Press">
                                                                                                                                    <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                    <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                </Storyboard>
                                                                                                                                <Storyboard x:Key="Release">
                                                                                                                                    <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                    <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                </Storyboard>
                                                                                                                            </ControlTemplate.Resources>
                                                                                                                            <Grid x:Name="Grid" Background="Transparent" Height="{TemplateBinding MinHeight}" SnapsToDevicePixels="True" Width="Auto">
                                                                                                                                <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" VerticalAlignment="Stretch" Width="Auto"/>
                                                                                                                                <Rectangle x:Name="RenderOverlay" HorizontalAlignment="Stretch" Margin="1" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" VerticalAlignment="Stretch" Width="Auto">
                                                                                                                                    <Rectangle.Fill>
                                                                                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                                                                            <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                                                                                                            <GradientStop Color="#0C000000" Offset="1"/>
                                                                                                                                        </LinearGradientBrush>
                                                                                                                                    </Rectangle.Fill>
                                                                                                                                    <Rectangle.Stroke>
                                                                                                                                        <LinearGradientBrush EndPoint="0.563,1.015" StartPoint="0.563,-0.026">
                                                                                                                                            <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                                                            <GradientStop Color="#19000000" Offset="1"/>
                                                                                                                                        </LinearGradientBrush>
                                                                                                                                    </Rectangle.Stroke>
                                                                                                                                </Rectangle>
                                                                                                                                <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" Color="White" CornerRadius="3" IsHitTestVisible="True" Margin="-1" Opacity="0"/>
                                                                                                                            </Grid>
                                                                                                                            <ControlTemplate.Triggers>
                                                                                                                                <Trigger Property="IsFocused" Value="True"/>
                                                                                                                                <Trigger Property="IsDragging" Value="True">
                                                                                                                                    <Trigger.EnterActions>
                                                                                                                                        <BeginStoryboard>
                                                                                                                                            <Storyboard>
                                                                                                                                                <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                                <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                            </Storyboard>
                                                                                                                                        </BeginStoryboard>
                                                                                                                                    </Trigger.EnterActions>
                                                                                                                                    <Trigger.ExitActions>
                                                                                                                                        <BeginStoryboard>
                                                                                                                                            <Storyboard>
                                                                                                                                                <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                                                <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                                            </Storyboard>
                                                                                                                                        </BeginStoryboard>
                                                                                                                                    </Trigger.ExitActions>
                                                                                                                                </Trigger>
                                                                                                                                <Trigger Property="IsEnabled" Value="False">
                                                                                                                                    <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                                                                                                </Trigger>
                                                                                                                            </ControlTemplate.Triggers>
                                                                                                                        </ControlTemplate>
                                                                                                                    </Setter.Value>
                                                                                                                </Setter>
                                                                                                            </Style>
                                                                                                        </Custom:SurfaceThumb.Style>
                                                                                                    </Custom:SurfaceThumb>
                                                                                                </Track.Thumb>
                                                                                            </Track>
                                                                                        </Border>
                                                                                    </Grid>
                                                                                    <ControlTemplate.Triggers>
                                                                                        <Trigger Property="Custom:TouchExtensions.AreAnyInputDevicesCapturedWithin" Value="True">
                                                                                            <Trigger.EnterActions>
                                                                                                <BeginStoryboard>
                                                                                                    <Storyboard>
                                                                                                        <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                                                        <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                                        <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                                    </Storyboard>
                                                                                                </BeginStoryboard>
                                                                                            </Trigger.EnterActions>
                                                                                            <Trigger.ExitActions>
                                                                                                <BeginStoryboard>
                                                                                                    <Storyboard>
                                                                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                                                    </Storyboard>
                                                                                                </BeginStoryboard>
                                                                                            </Trigger.ExitActions>
                                                                                        </Trigger>
                                                                                        <Trigger Property="IsEnabled" Value="False">
                                                                                            <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                                                                            <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                                                                            <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                                                                            <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                                                                        </Trigger>
                                                                                    </ControlTemplate.Triggers>
                                                                                </ControlTemplate>
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                    </Trigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Custom:SurfaceScrollBar.Style>
                                                    </Custom:SurfaceScrollBar>
                                                </Grid>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsEnabled" Value="False">
                                                        <Setter Property="IsEnabled" TargetName="PART_HorizontalScrollBar" Value="False"/>
                                                        <Setter Property="IsEnabled" TargetName="PART_VerticalScrollBar" Value="False"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Custom:SurfaceScrollViewer.Style>
                            <ItemsPresenter ClipToBounds="False" Margin="0" MinWidth="30" MinHeight="30" OpacityMask="{x:Null}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Custom:SurfaceScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="BorderBrush" TargetName="Border" Value="#33000000"/>
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="True">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>